<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
  html { height: 100% }
  body { height: 100%; margin: 0px; padding: 0px }
  #map_canvas { height: 400px }
</style>

</head> dfdgfg
<body >

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&language=th" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var cm_map;
var cm_openInfowindow;
var cm_mapMarkers = [];
var cm_mapHTMLS = [];
var entryArray = [];
// Config 
	//Default LatLng
	var defaultLat =13.063175;
	var defaultLng =100.893116;
	//Default ZOOM Map
	var zoom = 14;
	//Marker Point[Lat,Lng,title,into(html)]		
	entryArray[0]=[13.083157,100.883417,'title1'
	           	,'tsert1<br>test'];
	entryArray[1]=[13.069529,100.896893,'title2'
	           	,'tsert2<br>test'];

	
	function initialize() {
		var cm_map = new GMap2(document.getElementById("cm_map")); 
		var center = new GLatLng(defaultLat,defaultLng); 
		cm_map.setCenter(center, zoom); 
		cm_map.setUIToDefault(); 

		for (var i = 0; i < entryArray.length; i++) {
			var entry = entryArray[i];
			var title = entry[2];
			var html = entry[3];
			
			var lat = eval(entry[0]);
			var lng = eval(entry[1]);
			point = new GLatLng(lat,lng);
			
			var marker = cm_createMarker(cm_map,point,title,html);
			cm_mapMarkers.push(marker);
			cm_mapHTMLS.push(html);
		}
  }

	function cm_createMarker(map,point,title,html){
		var marker = new GMarker(point);  
		  GEvent.addListener(marker, "click", function() {   
			  	marker.openInfoWindowHtml(html);   
			 }); 	
		  GEvent.addListener(marker, "clickable_changed", function() {   
			  	marker.close();   
			 });	 	    	
		map.addOverlay(marker);
		return marker;
	}
 
  /**
   * Function called when marker on the map is clicked.
   * Opens an info window (bubble) above the marker.
   * @param {Number} markerNum Number of marker in global array
   */
  function cm_markerClicked(markerNum) {
	  var infowindow = cm_mapMarkers[markerNum].openInfoWindowHtml(cm_mapHTMLS[markerNum]);  
	  cm_setInfowindow(infowindow);
  }
   
   function cm_setInfowindow(newInfowindow) {
     if (cm_openInfowindow != undefined) {
       cm_openInfowindow.close();
     }
    
     cm_openInfowindow = newInfowindow;
   }
 //]]>

</script>
  <div id="cm_map" style="width:600px; height:500px" ></div>
  <a href="javascript:cm_markerClicked('0');" >marker1</a>
  <a href="javascript:cm_markerClicked('1');" >marker2</a>
  <script type="text/javascript">initialize();</script>
</body>
</html>